package Sort.面试.信必优;

/**
 * i like beijing.
 *  变成
 *  beijing. like i
 */
public class ReverseWord {

    public static void main(String[] args) {
        String s = "i like beijing.";
        reverse(s);
    }

    public static String reverse(String s){
        String[] strs = s.split(" ");

        String res = "";
        for(int i = strs.length-1; i >= 0; i--){
            System.out.printf(strs[i] + " ");
        }
        return res;
    }
}
